function transformData(parent, arr) {
  if (!arr) {
    return null;
  }
  let arr_ = Object.assign(arr);
  return arr_.map(item => {
    item.component_ = (parent ? parent.component_ : "") + item.component;
    item.path = (parent ? parent.path : "") + item.path_;
    item.children = transformData(item, item.children);
    return item;
  });
}
function addRoutesCycle(arr) {
  return arr.map(item_ => {
    try {
      item_.component = require(`@/views${item_.component_}/index.vue`).default;
    } catch (e) {
      item_.component = require(`@/views/blank/index.vue`).default;
    }
    if (item_.children) {
      item_.children = addRoutesCycle(item_.children);
    }
    return item_;
  });
}
export default {
  transformData,
  addRoutesCycle
}
